{ INFORMATICS.MCCME.RU
  Problem statement: http://informatics.mccme.ru/moodle/mod/statements/view3.php?chapterid=1456
  Verdict: Accepted
}
uses SysUtils, Math;
 
var
	i,n,kk:longint;
	a:array[0..10010] of longint;
 
begin
reset(input,'input.txt');
rewrite(output,'output.txt');
read(n);
for i:=1 to n do
	read(a[i]);
read(kk);
for i:=1 to n do
	if a[i]<kk then begin
		write(i);
		halt;
	end;
write(n+1);
end.